/* 插件
 * @Author: maskMan
 * @LastEditTime: 2024-11-14 16:37:16
 * @Descripttion:快捷方式调用
 */
declare module "vue/types/vue" {
  interface Vue {
    $msgboxErr(message: string): void;
    $msgboxSuc(message: string): void;
    $msgSuc(message: string): void;
    $msgErr(message: string): void;
  }
}
export default {
  install(Vue) {
    Vue.prototype.$msgboxErr = function (message?: string) {
      this.$msgbox({
        title: "错误提示",
        message: message || "失败",
        showCancelButton: false,
        showConfirmButton: true,
        type: "error",
        center: true,
        confirmButtonText: "OK",
      });
    };
    Vue.prototype.$msgboxSuc = function (message?: string) {
      this.$msgbox({
        title: "错误",
        message: message || "成功",
        showCancelButton: false,
        showConfirmButton: true,
        type: "success",
        center: true,
        confirmButtonText: "OK",
      });
    };
    Vue.prototype.$msgSuc = function (message?: string) {
      this.$message({
        message: message || "成功",
        type: "success", // 设置为 success 类型
        duration: 3000, // 持续时间，3秒后自动关闭
      });
    };
    Vue.prototype.$msgErr = function (message?: string) {
      this.$message({
        message: message || "错误",
        type: "error", // 设置为 success 类型
        duration: 3000, // 持续时间，3秒后自动关闭
      });
    };
  },
};
